package com.linh.rmi.client;

import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;

import com.linh.rmi.common.SampleRmiService;

public class SampleRmiServiceClient {

	/**
	 * @param args
	 */
	public static void main(String[] args) throws Exception {
		// get the registry
		Registry remoteRegistry = LocateRegistry
				.getRegistry("RemoteHost", 1222);
		// look up
		SampleRmiService remoteService = (SampleRmiService) remoteRegistry
				.lookup(SampleRmiService.class.getName());
		remoteService.doService();
	}

}
